package com.ask.idea.test.buffer;

import java.nio.ByteBuffer;

/**
 * 说明：
 *
 * <p>作者：FisherHao
 *
 * <p>时间：2020-09-12 22:14
 */
public class BufferMain {

    public static void main(String[] args) {
        BufferMain buffer = new BufferMain ();
        buffer.directBuffer ();
    }

    /***
     * 直接缓冲区
     */
    private void directBuffer() {
        //在直接内存中分配buffer
        ByteBuffer buf = ByteBuffer.allocateDirect (1024);

        System.out.println ("判断是否为直接缓冲区");
        System.out.println (buf.isDirect ());
    }
}
